package com.rd.student.jike.class4.wanghaixin.test0801;

import java.util.Arrays;

public class Test04 {
    public static void main(String[] args) {
        int arrays[] = {60,77,33,55,11,22,80};
        for (int i = 0; i < arrays.length; i++) {
            int s = arrays[i];
            int index = i;
            for (int j = i+1; j < arrays.length; j++) {
                if(s>arrays[j]){
                    index = j;
                    s = arrays[j];
                }
            }
            int temp = arrays[i];
            arrays[i]=arrays[index];
            arrays[index]=temp;
        }
        System.out.println(Arrays.toString(arrays));
    }
}
